<%@ page import="com.yinhai.core.common.api.config.impl.SysConfig"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<jsp:directive.page import="java.util.Date" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<%@ taglib prefix="ta" tagdir="/WEB-INF/tags/tatags"%>

<html xmlns="http://www.w3.org/1999/xhtml" style="height:100%">
<head>
<title>app配置</title>
</head>
<%@ include file="/ta/inc.jsp"%>
<body >
	<ta:pageloading />
	<ta:box minWidth="1000" fit="true" cssStyle="margin-top:5px">
		<ta:panel id="pnlSmsQry" key="查询条件" cols="3" >
			<ta:text id="qry_appKey" key="appKey" />
			<ta:text id="qry_systemName" key="系统名称" />
			<ta:buttonLayout>
				<ta:button id="appQry" isok="true" key="查询" onClick="fnQueryApp()" />
				<ta:button id="appClear" key="清空" onClick="fnClear()" />
			</ta:buttonLayout>
		</ta:panel>
		<ta:panel id="pnlApp" key="应用" withToolBar="true" fit="true" columnWidth="0.25">
			<ta:panelToolBar>
				<ta:button id="btnAddApp" key="新增[A]" hotKey="a" icon="icon-add" isShowIcon="true" asToolBarItem="true" onClick="fnAddApp()" />
			</ta:panelToolBar>
			<ta:datagrid id="appgrid" fit="true" haveSn="true" clickActiveStyle="true" forceFitColumns="true" columnFilter="true" >
				<ta:datagridItem id="appKey" key="appKey" sortable="true" />
				<ta:datagridItem id="defaultApp" key="默认应用" collection="YESORNO"  sortable="true"/>
				<ta:datagridItem id="systemId" key="接入系统ID" sortable="true"/>
				<ta:datagridItem id="systemName" key="接入系统名称" sortable="true"/>
				<ta:datagridItemOperate id="a" showAll="false" name="操作">
					<ta:datagridItemOperateMenu icon="a" name="编辑" click="fnUpdateApp" />
					<ta:datagridItemOperateMenu icon="a" name="删除" click="fnDeleteApp" />
				</ta:datagridItemOperate>
				<ta:dataGridToolPaging url="AppConfigController!queryAllAppConfigByPage.do" showCount="true" pageSize="10" />
			</ta:datagrid>
		</ta:panel>
	</ta:box>
</body>
</html>
<script type="text/javascript">
	
	$(document).ready(function() {
		$("body").taLayout();
		fnQueryApp();
	});
	
	/*查询短信平台 */
	function fnQueryApp(){
		Base.clearGridDirty("appgrid");
		Base.submit("qry_appKey,qry_systemName","AppConfigController!queryAllAppConfigByPage.do");
	}
	
	/* 新增app */
	function fnAddApp(){
		Base.openWindow("addconfigapp","添加app配置","AppConfigController!toAddAppConfig.do",null, 650, 500,  null,null,true);
	}
	
	/* 编辑app */
	function fnUpdateApp(r){
		Base.openWindow("editconfigapp","编辑app配置","AppConfigController!toEditAppConfig.do",{"dto['appKey']":r.appKey},650, 500, null,null,true);
	}
	
	/* 删除APP */
	function fnDeleteApp(r){
		Base.confirm("确定删除app吗?",function(yes){
			if(yes){
				Base.submit("","AppConfigController!deleteAppConfig.do",{"dto['appKey']":r.appKey},null,null,function(){
					Base.msgTopTip("删除成功!");
					fnQueryApp();
				});
			}
		}); 
	}
	
	/* 清空查询框  */
	function fnClear(){
		Base.setValue("qry_appKey","");
		Base.setValue("qry_systemName","");
	}
</script>
<%@ include file="/ta/incfooter.jsp"%>